{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 预处理 网力照片 标签数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import pymysql \n",
    "import os,shutil\n",
    "from pathlib import Path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "db = pymysql.connect(host='localhost',port=3306,user='root',passwd='123456',charset='UTF8',db='id_info_cahe_copy') \n",
    "cur = db.cursor() \n",
    "\n",
    "sql=\"\"\"SELECT\n",
    "*\n",
    "FROM\n",
    "id_info\n",
    "limit 1000 \"\"\"\n",
    "\n",
    "df1 =pd.read_sql(sql,con=db)\n",
    " \n",
    "\n",
    "sql=\"\"\"SELECT\n",
    "*\n",
    "FROM\n",
    "id_info\n",
    "where name like \"王%\"  \"\"\"\n",
    "\n",
    "df2=pd.read_sql(sql,con=db)\n",
    "\n",
    " \n",
    "\n",
    "df3= df1.append(df2, ignore_index=True)\n",
    "\n",
    "print(df3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 归类好训练文件\n",
    "# **注意windows上的管理员可能会访问不了网络磁盘** 不要用管理源运行 \n",
    "idAndpath=df3.loc[:,[\"idcard\",\"image_path\"]]\n",
    "tmp=len(\"/app/id_img\")\n",
    "for index ,i in enumerate(idAndpath.values):\n",
    "    idcardLabelFolder=os.path.normpath(\"X:/share/image/train_id_img_label/\"+i[0])\n",
    "    if not os.path.exists(idcardLabelFolder) :\n",
    "        os.mkdir(idcardLabelFolder)\n",
    "        print(idcardLabelFolder)\n",
    "   \n",
    "        source=os.path.normpath(\"X:/share/image/train_id_img/\"+ i[1][tmp+1:])\n",
    "        print(source)\n",
    "        shutil.copy(source,idcardLabelFolder)\n",
    "    end=index\n",
    "else:\n",
    "    print(end)\n",
    "#print(idAndpath)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "import sys,re,shutil\n",
    "\n",
    "sys.path.append(\"../\")\n",
    "from sjlib import sjtext\n",
    "file_dir=r\"X:\\share\\image\\mydataset\\test_img/\"\n",
    "dist_dir=file_dir #r\"D:/docker\\mnt\\openface\\data\\mydataset\\train_img/\"\n",
    "\n",
    "#将原始数据 分类文件 打上标签\n",
    "for root, dirs, files in os.walk(file_dir):\n",
    "    for file in files:\n",
    "        #创建目录\n",
    "        folderLabel= re.sub(\"\\d|\\W\",\"\",file[:-4]) \n",
    "        folderLabelDir= dist_dir+folderLabel\n",
    "        os.mkdir(folderLabelDir) if not os.path.exists(folderLabelDir) else print(\"exist path \"+folderLabelDir)\n",
    "        #复制图片到分类目录中\n",
    "        if folderLabel in file :\n",
    "           # shutil.copy(root+\"/\"+file,folderLabelDir) # 复制图片\n",
    "            shutil.move(root+\"/\"+file,folderLabelDir) #移动图片\n",
    "\n",
    "\n",
    " "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 随机取出所有数据中的3张作为训练数据，其余作为测试数据。 不足三张则不训练\n",
    "import glob,random\n",
    "train_dir=dist_dir\n",
    "test_dir=r\"D:\\docker\\mnt\\openface\\data\\mydataset\\test_img/\"\n",
    "\n",
    "train_img_number=9\n",
    "\n",
    "allFolderList=glob.glob(train_dir+\"/*\")\n",
    "for folder in allFolderList:\n",
    "    test_imgList=glob.glob(folder + \"/*\")\n",
    "    #随机取出 totol - number 个 留下 number 个，不足则不取出\n",
    "    if len(test_imgList)>train_img_number:\n",
    "        test_imgList=random.sample(test_imgList,len(test_imgList)-train_img_number)\n",
    "        for test_img in test_imgList:\n",
    "            shutil.move(test_img,test_dir)\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 训练分类数据 取出一张\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'002'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"2\".zfill(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "FileExistsError",
     "evalue": "[WinError 183] 当文件已存在时，无法创建该文件。: '000'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileExistsError\u001b[0m                           Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-1-20277c941e38>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      9\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m100\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 10\u001b[1;33m     \u001b[0mPath\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mzfill\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32mc:\\program files\\python36\\lib\\pathlib.py\u001b[0m in \u001b[0;36mmkdir\u001b[1;34m(self, mode, parents, exist_ok)\u001b[0m\n\u001b[0;32m   1244\u001b[0m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_raise_closed\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1245\u001b[0m         \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1246\u001b[1;33m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_accessor\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmode\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1247\u001b[0m         \u001b[1;32mexcept\u001b[0m \u001b[0mFileNotFoundError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1248\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mparents\u001b[0m \u001b[1;32mor\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mparent\u001b[0m \u001b[1;33m==\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\program files\\python36\\lib\\pathlib.py\u001b[0m in \u001b[0;36mwrapped\u001b[1;34m(pathobj, *args)\u001b[0m\n\u001b[0;32m    385\u001b[0m         \u001b[1;33m@\u001b[0m\u001b[0mfunctools\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwraps\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstrfunc\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    386\u001b[0m         \u001b[1;32mdef\u001b[0m \u001b[0mwrapped\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpathobj\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 387\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mstrfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpathobj\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    388\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0mstaticmethod\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mwrapped\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    389\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mFileExistsError\u001b[0m: [WinError 183] 当文件已存在时，无法创建该文件。: '000'"
     ]
    }
   ],
   "source": [
    "import os ,sys\n",
    "from pathlib import Path\n",
    "import pathlib ,shutil\n",
    "\n",
    "os.chdir(r\"X:\\share\\image\\CASIA-FaceV5-classfiy100\")\n",
    "source_dir=r\"X:\\share\\image\\CASIA-FaceV5-align_img160\"\n",
    "\n",
    "\n",
    "for i in range(100):\n",
    "    Path(str(i).zfill(3)).mkdir()\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "path000=Path(source_dir).glob(\"*\")\n",
    "\n",
    "pwd=os.getcwd()\n",
    "dis_dir_list=[i for i in Path(pwd).glob('*')]\n",
    "\n",
    "#dis_dir_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "cnt=0\n",
    "src_file_list=[]\n",
    "for i in path000:\n",
    "    file_list=Path(i).glob(\"*\")\n",
    "    #print(i)\n",
    "    for j in file_list:\n",
    "        src_file_list.append(j)\n",
    "        break\n",
    "#src_file_list   \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "for j,k in zip(src_file_list,dis_dir_list):\n",
    "    shutil.copy(j,k)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X:\\share\\image\\aligen160_lfw\\Abdullah_Gul\n",
      "X:\\share\\image\\aligen160_lfw\\Adrien_Brody\n",
      "X:\\share\\image\\aligen160_lfw\\Alejandro_Toledo\n",
      "X:\\share\\image\\aligen160_lfw\\Alvaro_Uribe\n",
      "X:\\share\\image\\aligen160_lfw\\Amelie_Mauresmo\n",
      "X:\\share\\image\\aligen160_lfw\\Andre_Agassi\n",
      "X:\\share\\image\\aligen160_lfw\\Andy_Roddick\n",
      "X:\\share\\image\\aligen160_lfw\\Angelina_Jolie\n",
      "X:\\share\\image\\aligen160_lfw\\Anna_Kournikova\n",
      "X:\\share\\image\\aligen160_lfw\\Ann_Veneman\n",
      "X:\\share\\image\\aligen160_lfw\\Ariel_Sharon\n",
      "X:\\share\\image\\aligen160_lfw\\Ari_Fleischer\n",
      "X:\\share\\image\\aligen160_lfw\\Arnold_Schwarzenegger\n",
      "X:\\share\\image\\aligen160_lfw\\Atal_Bihari_Vajpayee\n",
      "X:\\share\\image\\aligen160_lfw\\Bill_Clinton\n",
      "X:\\share\\image\\aligen160_lfw\\Bill_Gates\n",
      "X:\\share\\image\\aligen160_lfw\\Bill_Simon\n",
      "X:\\share\\image\\aligen160_lfw\\Britney_Spears\n",
      "X:\\share\\image\\aligen160_lfw\\Carlos_Menem\n",
      "X:\\share\\image\\aligen160_lfw\\Carlos_Moya\n",
      "X:\\share\\image\\aligen160_lfw\\Catherine_Zeta-Jones\n",
      "X:\\share\\image\\aligen160_lfw\\Charles_Moose\n",
      "X:\\share\\image\\aligen160_lfw\\Colin_Powell\n",
      "X:\\share\\image\\aligen160_lfw\\Condoleezza_Rice\n",
      "X:\\share\\image\\aligen160_lfw\\David_Beckham\n",
      "X:\\share\\image\\aligen160_lfw\\David_Nalbandian\n",
      "X:\\share\\image\\aligen160_lfw\\Dick_Cheney\n",
      "X:\\share\\image\\aligen160_lfw\\Dominique_de_Villepin\n",
      "X:\\share\\image\\aligen160_lfw\\Donald_Rumsfeld\n",
      "X:\\share\\image\\aligen160_lfw\\Edmund_Stoiber\n",
      "X:\\share\\image\\aligen160_lfw\\Eduardo_Duhalde\n",
      "X:\\share\\image\\aligen160_lfw\\Fidel_Castro\n",
      "X:\\share\\image\\aligen160_lfw\\George_HW_Bush\n",
      "X:\\share\\image\\aligen160_lfw\\George_Robertson\n",
      "X:\\share\\image\\aligen160_lfw\\George_W_Bush\n",
      "X:\\share\\image\\aligen160_lfw\\Gerhard_Schroeder\n",
      "X:\\share\\image\\aligen160_lfw\\Gloria_Macapagal_Arroyo\n",
      "X:\\share\\image\\aligen160_lfw\\Gonzalo_Sanchez_de_Lozada\n",
      "X:\\share\\image\\aligen160_lfw\\Gordon_Brown\n",
      "X:\\share\\image\\aligen160_lfw\\Gray_Davis\n",
      "X:\\share\\image\\aligen160_lfw\\Guillermo_Coria\n",
      "X:\\share\\image\\aligen160_lfw\\Halle_Berry\n",
      "X:\\share\\image\\aligen160_lfw\\Hamid_Karzai\n",
      "X:\\share\\image\\aligen160_lfw\\Hans_Blix\n",
      "X:\\share\\image\\aligen160_lfw\\Harrison_Ford\n",
      "X:\\share\\image\\aligen160_lfw\\Hillary_Clinton\n",
      "X:\\share\\image\\aligen160_lfw\\Howard_Dean\n",
      "X:\\share\\image\\aligen160_lfw\\Hugo_Chavez\n",
      "X:\\share\\image\\aligen160_lfw\\Hu_Jintao\n",
      "X:\\share\\image\\aligen160_lfw\\Igor_Ivanov\n",
      "X:\\share\\image\\aligen160_lfw\\Jackie_Chan\n",
      "X:\\share\\image\\aligen160_lfw\\Jack_Straw\n",
      "X:\\share\\image\\aligen160_lfw\\Jacques_Chirac\n",
      "X:\\share\\image\\aligen160_lfw\\James_Blake\n",
      "X:\\share\\image\\aligen160_lfw\\James_Kelly\n",
      "X:\\share\\image\\aligen160_lfw\\Jean_Charest\n",
      "X:\\share\\image\\aligen160_lfw\\Jean_Chretien\n",
      "X:\\share\\image\\aligen160_lfw\\Jeb_Bush\n",
      "X:\\share\\image\\aligen160_lfw\\Jennifer_Aniston\n",
      "X:\\share\\image\\aligen160_lfw\\Jennifer_Capriati\n",
      "X:\\share\\image\\aligen160_lfw\\Jennifer_Garner\n",
      "X:\\share\\image\\aligen160_lfw\\Jennifer_Lopez\n",
      "X:\\share\\image\\aligen160_lfw\\Jeremy_Greenstock\n",
      "X:\\share\\image\\aligen160_lfw\\Jiang_Zemin\n",
      "X:\\share\\image\\aligen160_lfw\\Jiri_Novak\n",
      "X:\\share\\image\\aligen160_lfw\\Joe_Lieberman\n",
      "X:\\share\\image\\aligen160_lfw\\John_Allen_Muhammad\n",
      "X:\\share\\image\\aligen160_lfw\\John_Ashcroft\n",
      "X:\\share\\image\\aligen160_lfw\\John_Bolton\n",
      "X:\\share\\image\\aligen160_lfw\\John_Howard\n",
      "X:\\share\\image\\aligen160_lfw\\John_Kerry\n",
      "X:\\share\\image\\aligen160_lfw\\John_Negroponte\n",
      "X:\\share\\image\\aligen160_lfw\\John_Paul_II\n",
      "X:\\share\\image\\aligen160_lfw\\John_Snow\n",
      "X:\\share\\image\\aligen160_lfw\\Joschka_Fischer\n",
      "X:\\share\\image\\aligen160_lfw\\Jose_Maria_Aznar\n",
      "X:\\share\\image\\aligen160_lfw\\Juan_Carlos_Ferrero\n",
      "X:\\share\\image\\aligen160_lfw\\Julianne_Moore\n",
      "X:\\share\\image\\aligen160_lfw\\Julie_Gerberding\n",
      "X:\\share\\image\\aligen160_lfw\\Junichiro_Koizumi\n",
      "X:\\share\\image\\aligen160_lfw\\Keanu_Reeves\n",
      "X:\\share\\image\\aligen160_lfw\\Kim_Clijsters\n",
      "X:\\share\\image\\aligen160_lfw\\Kim_Ryong-sung\n",
      "X:\\share\\image\\aligen160_lfw\\Kofi_Annan\n",
      "X:\\share\\image\\aligen160_lfw\\Lance_Armstrong\n",
      "X:\\share\\image\\aligen160_lfw\\Laura_Bush\n",
      "X:\\share\\image\\aligen160_lfw\\Lindsay_Davenport\n",
      "X:\\share\\image\\aligen160_lfw\\Lleyton_Hewitt\n",
      "X:\\share\\image\\aligen160_lfw\\Lucio_Gutierrez\n",
      "X:\\share\\image\\aligen160_lfw\\Luiz_Inacio_Lula_da_Silva\n",
      "X:\\share\\image\\aligen160_lfw\\Mahathir_Mohamad\n",
      "X:\\share\\image\\aligen160_lfw\\Mahmoud_Abbas\n",
      "X:\\share\\image\\aligen160_lfw\\Mark_Philippoussis\n",
      "X:\\share\\image\\aligen160_lfw\\Megawati_Sukarnoputri\n",
      "X:\\share\\image\\aligen160_lfw\\Meryl_Streep\n",
      "X:\\share\\image\\aligen160_lfw\\Michael_Bloomberg\n",
      "X:\\share\\image\\aligen160_lfw\\Michael_Jackson\n",
      "X:\\share\\image\\aligen160_lfw\\Michael_Schumacher\n",
      "X:\\share\\image\\aligen160_lfw\\Mike_Weir\n",
      "X:\\share\\image\\aligen160_lfw\\Mohammed_Al-Douri\n",
      "X:\\share\\image\\aligen160_lfw\\Nancy_Pelosi\n",
      "X:\\share\\image\\aligen160_lfw\\Naomi_Watts\n",
      "X:\\share\\image\\aligen160_lfw\\Nestor_Kirchner\n",
      "X:\\share\\image\\aligen160_lfw\\Nicanor_Duarte_Frutos\n",
      "X:\\share\\image\\aligen160_lfw\\Nicole_Kidman\n",
      "X:\\share\\image\\aligen160_lfw\\Norah_Jones\n",
      "X:\\share\\image\\aligen160_lfw\\Paul_Bremer\n",
      "X:\\share\\image\\aligen160_lfw\\Paul_Burrell\n",
      "X:\\share\\image\\aligen160_lfw\\Pervez_Musharraf\n",
      "X:\\share\\image\\aligen160_lfw\\Pete_Sampras\n",
      "X:\\share\\image\\aligen160_lfw\\Pierce_Brosnan\n",
      "X:\\share\\image\\aligen160_lfw\\Queen_Elizabeth_II\n",
      "X:\\share\\image\\aligen160_lfw\\Recep_Tayyip_Erdogan\n",
      "X:\\share\\image\\aligen160_lfw\\Renee_Zellweger\n",
      "X:\\share\\image\\aligen160_lfw\\Ricardo_Lagos\n",
      "X:\\share\\image\\aligen160_lfw\\Richard_Gephardt\n",
      "X:\\share\\image\\aligen160_lfw\\Richard_Myers\n",
      "X:\\share\\image\\aligen160_lfw\\Roger_Federer\n",
      "X:\\share\\image\\aligen160_lfw\\Roh_Moo-hyun\n",
      "X:\\share\\image\\aligen160_lfw\\Rubens_Barrichello\n",
      "X:\\share\\image\\aligen160_lfw\\Rudolph_Giuliani\n",
      "X:\\share\\image\\aligen160_lfw\\Saddam_Hussein\n",
      "X:\\share\\image\\aligen160_lfw\\Salma_Hayek\n",
      "X:\\share\\image\\aligen160_lfw\\Serena_Williams\n",
      "X:\\share\\image\\aligen160_lfw\\Sergey_Lavrov\n",
      "X:\\share\\image\\aligen160_lfw\\Sergio_Vieira_De_Mello\n",
      "X:\\share\\image\\aligen160_lfw\\Silvio_Berlusconi\n",
      "X:\\share\\image\\aligen160_lfw\\Spencer_Abraham\n",
      "X:\\share\\image\\aligen160_lfw\\Taha_Yassin_Ramadan\n",
      "X:\\share\\image\\aligen160_lfw\\Tang_Jiaxuan\n",
      "X:\\share\\image\\aligen160_lfw\\Tiger_Woods\n",
      "X:\\share\\image\\aligen160_lfw\\Tim_Henman\n",
      "X:\\share\\image\\aligen160_lfw\\Tommy_Franks\n",
      "X:\\share\\image\\aligen160_lfw\\Tom_Daschle\n",
      "X:\\share\\image\\aligen160_lfw\\Tom_Ridge\n",
      "X:\\share\\image\\aligen160_lfw\\Tony_Blair\n",
      "X:\\share\\image\\aligen160_lfw\\Trent_Lott\n",
      "X:\\share\\image\\aligen160_lfw\\Venus_Williams\n",
      "X:\\share\\image\\aligen160_lfw\\Vicente_Fox\n",
      "X:\\share\\image\\aligen160_lfw\\Vladimir_Putin\n",
      "X:\\share\\image\\aligen160_lfw\\Wen_Jiabao\n",
      "X:\\share\\image\\aligen160_lfw\\Winona_Ryder\n",
      "X:\\share\\image\\aligen160_lfw\\Yoriko_Kawaguchi\n"
     ]
    }
   ],
   "source": [
    "## 选取lfw 中大于10张样本的 ,复制到xxx\n",
    "src=r\"X:\\share\\image\\aligen160_lfw\"\n",
    "dst=r\"X:\\share\\image\\lfw_classfiy_great10\"\n",
    "from pathlib import Path\n",
    "import shutil\n",
    "\n",
    "def get_file_path_list():\n",
    "    file_path_list=[]\n",
    "    for i in Path(src).glob(\"*\"):\n",
    "        try:\n",
    "            if len(list(Path(i).iterdir())) >10:\n",
    "                print(i)\n",
    "                file_path_list+=[i]\n",
    "        except NotADirectoryError:\n",
    "            pass\n",
    "    return file_path_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'file_path_list' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-25-c2aae34a1740>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      2\u001b[0m  \u001b[1;31m#选择目录名\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;31m# 选择数量 break\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mfile_path_list\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      5\u001b[0m     \u001b[0mt\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mPath\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mparts\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      6\u001b[0m     \u001b[0mnewPath\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mPath\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mjoinpath\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mt\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m\"\\lfw_classfiy_image_equel1_gener\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mt\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'file_path_list' is not defined"
     ]
    }
   ],
   "source": [
    "# 创建目录 ，移动图片\n",
    " #选择目录名\n",
    "# 选择数量 break\n",
    "for i in file_path_list:\n",
    "    t=Path(i).parts\n",
    "    newPath=Path(i).joinpath(*t[:-2],\"\\lfw_classfiy_image_equel1_gener\",t[-1])\n",
    "    try:\n",
    "        newPath.mkdir()\n",
    "    except FileExistsError:\n",
    "        pass\n",
    "        #复制图片\n",
    "    for j in Path(i).glob(\"*\"):\n",
    "        shutil.copy(j,newPath)\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iam a test\n",
      "X:\\share\\image\\lfw_classfiy_image_equel1_gener\\Abdullah_Gul\\Abdullah_Gul_0001.png\n",
      "X:\\share\\image\\lfw_classfiy_image_equel1_gener\\Abdullah_Gul\\brigth.jpg\n",
      "X:\\share\\image\\lfw_classfiy_image_equel1_gener\\Abdullah_Gul\\brigth.jpg\n",
      "X:\\share\\image\\lfw_classfiy_image_equel1_gener\\Abdullah_Gul\\brigth.jpg\n"
     ]
    }
   ],
   "source": [
    "%run func_index.ipynb\n",
    "\n",
    "src_root=r\"X:\\share\\image\\lfw_classfiy_image_equel1_gener\"\n",
    "for src in Path(src_root).iterdir():\n",
    "    gener_image(src,src)\n",
    "   \n",
    "    break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Abdullah_Gul'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Adrien_Brody'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Alejandro_Toledo'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Alvaro_Uribe'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Amelie_Mauresmo'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Andre_Agassi'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Andy_Roddick'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Angelina_Jolie'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Anna_Kournikova'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Ann_Veneman'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Ariel_Sharon'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Ari_Fleischer'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Arnold_Schwarzenegger'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Atal_Bihari_Vajpayee'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Bill_Clinton'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Bill_Gates'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Bill_Simon'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Britney_Spears'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Carlos_Menem'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Carlos_Moya'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Catherine_Zeta-Jones'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Charles_Moose'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Colin_Powell'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Condoleezza_Rice'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/David_Beckham'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/David_Nalbandian'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Dick_Cheney'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Dominique_de_Villepin'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Donald_Rumsfeld'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Edmund_Stoiber'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Eduardo_Duhalde'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Fidel_Castro'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/George_HW_Bush'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/George_Robertson'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/George_W_Bush'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Gerhard_Schroeder'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Gloria_Macapagal_Arroyo'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Gonzalo_Sanchez_de_Lozada'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Gordon_Brown'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Gray_Davis'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Guillermo_Coria'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Halle_Berry'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Hamid_Karzai'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Hans_Blix'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Harrison_Ford'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Hillary_Clinton'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Howard_Dean'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Hugo_Chavez'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Hu_Jintao'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Igor_Ivanov'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jackie_Chan'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jack_Straw'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jacques_Chirac'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/James_Blake'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/James_Kelly'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jean_Charest'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jean_Chretien'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jeb_Bush'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jennifer_Aniston'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jennifer_Capriati'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jennifer_Garner'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jennifer_Lopez'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jeremy_Greenstock'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jiang_Zemin'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jiri_Novak'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Joe_Lieberman'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/John_Allen_Muhammad'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/John_Ashcroft'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/John_Bolton'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/John_Howard'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/John_Kerry'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/John_Negroponte'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/John_Paul_II'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/John_Snow'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Joschka_Fischer'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Jose_Maria_Aznar'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Juan_Carlos_Ferrero'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Julianne_Moore'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Julie_Gerberding'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Junichiro_Koizumi'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Keanu_Reeves'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Kim_Clijsters'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Kim_Ryong-sung'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Kofi_Annan'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Lance_Armstrong'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Laura_Bush'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Lindsay_Davenport'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Lleyton_Hewitt'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Lucio_Gutierrez'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Luiz_Inacio_Lula_da_Silva'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Mahathir_Mohamad'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Mahmoud_Abbas'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Mark_Philippoussis'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Megawati_Sukarnoputri'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Meryl_Streep'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Michael_Bloomberg'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Michael_Jackson'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Michael_Schumacher'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Mike_Weir'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Mohammed_Al-Douri'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Nancy_Pelosi'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Naomi_Watts'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Nestor_Kirchner'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Nicanor_Duarte_Frutos'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Nicole_Kidman'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Norah_Jones'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Paul_Bremer'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Paul_Burrell'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Pervez_Musharraf'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Pete_Sampras'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Pierce_Brosnan'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Queen_Elizabeth_II'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Recep_Tayyip_Erdogan'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Renee_Zellweger'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Ricardo_Lagos'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Richard_Gephardt'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Richard_Myers'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Roger_Federer'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Roh_Moo-hyun'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Rubens_Barrichello'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Rudolph_Giuliani'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Saddam_Hussein'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Salma_Hayek'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Serena_Williams'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Sergey_Lavrov'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Sergio_Vieira_De_Mello'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Silvio_Berlusconi'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Spencer_Abraham'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Taha_Yassin_Ramadan'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Tang_Jiaxuan'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Tiger_Woods'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Tim_Henman'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Tommy_Franks'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Tom_Daschle'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Tom_Ridge'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Tony_Blair'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Trent_Lott'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Venus_Williams'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Vicente_Fox'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Vladimir_Putin'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Wen_Jiabao'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Winona_Ryder'),\n",
       " WindowsPath('X:/share/image/lfw_classfiy_image_equel1_gener/Yoriko_Kawaguchi')]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[i for i in Path(r\"X:\\share\\image\\lfw_classfiy_image_equel1_gener\").iterdir()]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 输出变换后的图片\n",
    "from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img\n",
    "import numpy as np\n",
    "datagen = ImageDataGenerator(\n",
    "        rotation_range=5,\n",
    "\n",
    "        zoom_range=0.01,\n",
    "        horizontal_flip=True,\n",
    "        fill_mode='nearest')\n",
    "# 路径存储\n",
    "gener=datagen.flow_from_directory(src_path,\n",
    "                                         batch_size=2,\n",
    "                                         shuffle=False,\n",
    "                                         save_to_dir=dst_path,\n",
    "                                         save_prefix='trans_',\n",
    "                                         save_format='jpg')\n",
    "for i in range(3):\n",
    "    gener.next()\n",
    "    \n",
    "        "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
